package com.yanqu.road.entity.kowloon.common;

import java.util.Objects;

public class Vec2 {

    private double x;

    private double y;

    private int moveType;

    public Vec2 clone(){
        Vec2 vec2 = new Vec2();
        vec2.setX(this.x);
        vec2.setY(this.y);
        vec2.setMoveType(this.moveType);
        return vec2;
    }

    public Vec2() {

    }

    public Vec2(double x, double y) {
        this.x = x;
        this.y = y;
    }

    public double getX() {
        return x;
    }

    public void setX(double x) {
        this.x = x;
    }

    public double getY() {
        return y;
    }

    public void setY(double y) {
        this.y = y;
    }

    public int getMoveType() {
        return moveType;
    }

    public void setMoveType(int moveType) {
        this.moveType = moveType;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Vec2 vec2 = (Vec2) o;
        return Double.compare(vec2.x, x) == 0 && Double.compare(vec2.y, y) == 0 && moveType == vec2.moveType;
    }

    @Override
    public int hashCode() {
        return Objects.hash(x, y, moveType);
    }
}
